package com.sixth.controller;

import com.sixth.bean.common.BasePageInfo;
import com.sixth.bean.common.BaseRespVo;
import com.sixth.service.AdminCollectService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName AdminCollectController
 * @Description TODO
 * @Author XiaoWJ
 * @Date 2022/9/7 19:30
 **/

@RestController
@RequestMapping("admin/collect")
public class AdminCollectController {


    @Autowired
    AdminCollectService adminCollectService;

    /**
     * 根据条件查询会员收藏数据
     * @Param  basePageInfo, userId, valueId
     * @Return BaseRespVo<Object>
     * @author XiaoWJ
     * @date   2022/9/7 20:10
     */


    @RequiresPermissions(value = {"admin:collect:list"}, logical = Logical.OR)

    @RequestMapping("list")
    public BaseRespVo<Object> list(BasePageInfo basePageInfo,Integer userId,Integer valueId){
        Object result = adminCollectService.list(basePageInfo,userId,valueId);

        return BaseRespVo.ok(result);

    }

}
